import { boot } from "quasar/wrappers";
import {
  ValidationProvider,
  extend,
  ValidationObserver,
  localize
} from "vee-validate";
import { required, email } from "vee-validate/dist/rules";
import zh from "vee-validate/dist/locale/zh_CN.json";
import en from "vee-validate/dist/locale/en.json";

export default boot(({ Vue }) => {
  localize({
    en,
    zh
  });
  extend("required", required);
  extend("email", email);
  extend("password", val => {
    return val.length >= 8 || "Password is at least 8 letters";
  });
  Vue.component("ValidationProvider", ValidationProvider);
  Vue.component("ValidationObserver", ValidationObserver);
});
